const http = require('http')
const fs = require('fs')


http.createServer((req, res)=>{
    const url = new URL(`http://localhost:8080${req.url}`)
    console.log(url.searchParams)
    console.log(typeof url.searchParams)
    console.log(url.pathname)
    console.log(req.url)

    // res.end(`http://localhost:8080${req.url}`)
    // fs.readFile(`./${req.url}`, (err, data)=>{
    //     if(err){
    //         console.log(err)
    //         res.end('404')
    //     }else{
    //         res.end(data)
    //     }
    // })

}).listen(8080)

